package com.triones.api.controller.web;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo;
import com.triones.api.entity.FeeThaliDO;
import com.triones.api.entity.HelpCategorizeDO;
import com.triones.api.entity.param.FeeThaliParams;
import com.triones.api.entity.vo.FeeThaliVO;
import com.triones.api.service.FeeThaliService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 费用套餐管理
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/system/feeThali")
public class FeeThaliController extends BaseController {

    private final FeeThaliService feeThaliService;

    /**
     * 列表（分页）
     */
    @SaCheckPermission("system:available:pageList")
    @GetMapping("/pageList")
    public TableDataInfo<FeeThaliVO> pageList(FeeThaliParams feeThaliParams, PageQuery pageQuery) {
        return feeThaliService.pageList(feeThaliParams, pageQuery);
    }

    /**
     * 新增费用套餐
     */
    @SaCheckPermission("system:available:add")
    @PostMapping("/add")
    public R<Void> addFeeThali(@Validated @RequestBody FeeThaliDO dto) {
        return toAjax(feeThaliService.addFeeThali(dto));
    }
}
